package org.example.controller;

import org.example.entity.Material;
import org.example.param.MaterialParam;
import org.example.service.MaterialService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import java.util.Map;

@RestController
@RequestMapping("/material")
public class MaterialController {
    @Resource
    MaterialService materialService;

    @PostMapping("/save")
    public Map<String, Object> save(Material material) {
        return materialService.save(material);
    }
    @GetMapping("/page")
    public Map<String,Object> page(MaterialParam param) {
        return materialService.page(param);
    }
    @PostMapping("/disable")
    public Map<String, Object> disable(Material material) {
        return materialService.disable(material);
    }
}
